package com.ytjj.qmyx.supplychain.mapper;

import com.ytjj.qmyx.supplychain.common.model.ProductSpecVO;
import com.ytjj.qmyx.supplychain.common.model.request.ProductSpecStockQureyRequest;
import com.ytjj.qmyx.supplychain.common.model.response.ProductSpecStockQureyResponse;
import com.ytjj.qmyx.supplychain.common.model.response.SupplyChainProductSpecStockResponse;
import com.ytjj.qmyx.supplychain.mapper.entity.YxProductSpec;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface ProductSpecMapper extends Mapper<YxProductSpec> {

    int deleteByProductId(@Param("productId") Integer productId);

    Integer selectProductAllSpecStock(@Param("productId") Integer productId);

    List<SupplyChainProductSpecStockResponse> selectProductAllSpecStockByProductIds(@Param("productIds")List<Integer> productIds);

    List<ProductSpecStockQureyResponse> getSpecStock(@Param("supplyIds") List<Integer> supplyIds);

    List<ProductSpecVO> selectByProductSpecIds(@Param("ids") List<Integer> productSpecIds);

    int selectProductSpecStockByProductId(@Param("productId") Integer productId);

    void updateBySupplyId(Integer productSpecSupplyId);

    /**
     * 更新规格库存
     */
    Integer updateSpecStockById(Integer id,Integer num,String type);
}
